SUBROUTINE EBOX1
     *Create a simple form with a single editbox, in which text is initially displayed

     *Include the RealWeb definitions
     INCLUDE #RW.INCLUDE.DEFS FROM /SYSFILES/REALWEB,BP

     * Start the HTML page.
     * Display the text 'Another Form' in the browser's title bar.
     CALL RW_START_HTML_PAGE("Edit box example", "", "", "", "")

     CALL RW_PUT("Please enter your name in the box, then click the Go button")

     * Start the HTML form, specifying that the subroutine HELLO should be
     * run when the submit button is clicked
     CALL RW_START_HTML_FORM("HELLO","FORM3","")

     * Set up the aClass parameter to specify the size of the box, its initial 
     * contents and the maximum length of entry permitted
     CLASS=""
     CLASS<2>=30
     CLASS<3>="YOUR NAME HERE"
     CLASS<4>=30

     CALL RW_EDIT_BOX("NAME","",CLASS)
     *Create the submit button
     CALL RW_SUBMIT_BUTTON("GO","")
     *Complete the form
     CALL RW_END_FORM

     *Complete the page.
     CALL RW_END_PAGE
RETURN
SUBROUTINE HELLO
     * Display a Hello message to a user submitting a form

     * Include the RealWeb definitions
     INCLUDE #RW.INCLUDE.DEFS FROM /SYSFILES/REALWEB,BP

     * Start the HTML page
     * Display the text 'Response to Form' in the browser's title bar
     CALL RW_START_HTML_PAGE("Response to Form", "", "", "", "")

     *Retrieve the value of NAME
     CALL RW_GET_PARAM("NAME",NAME)
     *Display a greeting
     CALL RW_PUT("Hello " :NAME)

     * Complete the page
     CALL RW_END_PAGE
RETURN

Go to top button